<!doctype html>
<!--
Tests that window and WebXR rAFs continue to fire while repositioning the
content quad.
-->
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css">
  </head>
  <body>
    <canvas id="webgl-canvas"></canvas>
    <script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script>
    <script src="../resources/webxr_e2e.js"></script>
    <script src="../resources/webxr_boilerplate.js"></script>
    <script>
      setup({single_test: true});

      var numRafs = 0;
      function stepCheckForRafs() {
        window.requestAnimationFrame(onWindowRaf);
      }

      function onWindowRaf() {
        numRafs++;
        if (numRafs == 3) {
          onMagicWindowXRFrameCallback = onXrRaf;
        } else {
          window.requestAnimationFrame(onWindowRaf);
        }
      }

      function onXrRaf() {
        numRafs++;
        if (numRafs == 6) {
          done();
        }
      }
    </script>
  </body>
</html>
